<div id="modal-form" class="modal hide" tabindex="-1">
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="blue bigger">Gallery </h4>
    </div>

    <div class="modal-body overflow-visible">
        <div class="row-fluid">

            <div class="row-fluid">
                <div class="span12">
                    <!--PAGE CONTENT BEGINS-->

                    <?php $gallery = Item::model()->with('gallery')->findAll(); ?>
                    <?php if (isset($gallery)) : ?>
                        <ul class="ace-thumbnails"> 
                            <?php foreach ($gallery as $key => $value) : ?>
                                <?php if ($value['Thumb_nails'] == 1) : ?>          
                                    <li>
                                        <a href="#" data-rel="colorbox" class="ace-thumbnails" title="<?php echo $value['gallery']['GalleryName']; ?>">
                                            <img src="<?php echo Yii::app()->baseUrl; ?>/timthumb.php?src=<?php echo Yii::app()->baseUrl; ?>/images/products/<?php echo $value['ItemName']; ?>&h=150&w=150" />
                                            <div class="text">
                                                <div class="inner"><?php echo $value['gallery']['GalleryName']; ?></div>
                                            </div>
                                        </a>

                                        <div class="tools tools-bottom" id-gallery="<?php echo $value['gallery']['GalleryId']; ?>">
                                            <a href="#" title="View Album">
                                                <i class="icon-check-empty "></i>
                                                <i style="display:none;" class="icon-check"></i>
                                            </a>
                                        </div>
                                    </li>
                                <?php endif; ?>
                            <?php endforeach; ?>
                        </ul>
                    <?php endif; ?>
                </div><!--/.span-->
            </div><!--/.row-fluid-->                    

        </div>
    </div>

    <div class="modal-footer">
        <button class="btn btn-small" data-dismiss="modal">
            <i class="icon-remove"></i>
            Cancel
        </button>

        <button class="btn btn-small btn-primary save-gallery">
            <i class="icon-ok"></i>
            Save
        </button>
    </div>
</div> 
<style>
    .check-thumb {
        margin-bottom: 30px;
    }
</style>